/**
 * 元字符 ([{\^$|?*+.}])
 */

var parttern1 = /[bc]at/i;

var parttern2 = new RegExp("[xi]aor", "i");

var parttern3 = new RegExp("^.*([0-9]+)");

var testString = "Ketty is xiaor's pet.";

var testStr = "I have a cat named Ketty.";

var test1 = "copyright 2003";

console.log(parttern1.test(testString));
console.log(parttern2.test(testString));

console.log(parttern1.test(testStr));
console.log(parttern2.test(testStr));

console.log(parttern3.exec(test1));